﻿Imports FixSoft.Tools.AnimationMaker
Imports System.Threading

Public Class TestForm
    Public Overrides Sub ResetAeroBackground()
        ExcludeControlFromAero(Button1)
    End Sub

    Private Sub TestForm_AfterStartAnimationFinish(ByVal Sender As Object) Handles Me.AfterStartAnimationFinish
        Bgw.RunWorkerAsync()
        Ant.BackgroundIntegerAnimation(Me, "PrivateField", 1000002, 1000002000)
    End Sub
    Private Sub TestForm_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
        BackColor = Color.White
        Panel1.BackColor = Color.White
    End Sub

    Private Sub TestForm_LocationChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LocationChanged
        Invalidate()
    End Sub
    Dim Ant As New Animation

    'Animation Maker works with non-public members,too!
    Private Property PrivateLeft As Integer
        Get
            Return Left
        End Get
        Set(ByVal value As Integer)
            Left = value
        End Set
    End Property
    Private PrivateField As Integer
    Private Sub TestForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
        'Me.Opacity = 0 '.001
        '  Ant.DoubleAnimation(Me, "Opacity", 1, 800)
        'Ant.IntegerAnimation(Me, "d", 400, 1000)
        'MsgBox(d)
        '  ImageAnimation1.Animate(100)
        '   Dim t As Point = Location
        ' Ant.PointAnimation(Me, "Location", New Point(505, 200), 2000)
        '   Ant.PointAnimation(Me, "Location", t, 1000)
        ' Ant.SizeAnimation(PictureBox1, "Size", New Size(512, 512), 1000)
        ' Ant.BackgroundColorAnimation(Me, "BackColor", Color.Red, 200, 1)
        FixSoft.Fixed.Forms.HyperAero.AeroColor = Color.Black
        AddAeroOrBasicMovableControl(Panel1)
        Ant.PlayAnimationWithAnyValue = True
        Ant.ImageFadeAnimation(PictureBox1, "Image", My.Resources.Videos_Library, 1000)
        Dim t As New Threading.Thread(AddressOf AAC)
        t.Start()
    End Sub
    Public d As Integer
    ' Public Shared Property AeroColor As Color
    Sub AAC()
        'On Error Resume Next
        While True
            Const Speed As Integer = 200
            Const AAll As Boolean = True
            Ant.ColorAnimation(Me, "AeroColor", Color.Red, Speed, , AAll)
            Ant.ColorAnimation(Me, "AeroColor", Color.OrangeRed, Speed, , AAll)
            Ant.ColorAnimation(Me, "AeroColor", Color.Orange, Speed, , AAll)
            Ant.ColorAnimation(Me, "AeroColor", Color.Yellow, Speed, , AAll)
            Ant.ColorAnimation(Me, "AeroColor", Color.GreenYellow, Speed, , AAll)
            Ant.ColorAnimation(Me, "AeroColor", Color.Green, Speed, , AAll)
            Ant.ColorAnimation(Me, "AeroColor", Color.Blue, Speed, , AAll)
            Ant.ColorAnimation(Me, "AeroColor", Color.DarkBlue, Speed, , AAll)
        End While
    End Sub
    Private Sub Bgw_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles Bgw.DoWork
        While True
            Ant.IntegerAnimation(Me, "PrivateLeft", Left + 50, 500)
            Ant.IntegerAnimation(Me, "PrivateLeft", Left - 50, 500)
            ' Ant.IntegerAnimation(Me, "Top", Top + 50, 500)
            ' Ant.IntegerAnimation(Me, "Top", Top - 50, 500)
        End While

        ' Ant.DoubleAnimation(Me, "Opacity", 1, 800)
        ' Ant.ColorAnimation(Panel1, "BackColor", Color.Green, 2000)
        '  MsgBox("Finish in background")
    End Sub

    Dim tmpAC As Color = AeroColor
    Private Sub TestForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        AeroColor = tmpAC
        End
    End Sub

    Private Sub Panel1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Panel1.Click

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Ant.ImageFadeAnimation(PictureBox1, "Image", My.Resources._1337660059_Natsu_Videos, 750, , True)
    End Sub

    Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        Me.AutoShowLabels = False
    End Sub
    Private Sub TestForm_Load_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AddAeroMarginMovableControl(PictureBox1)
        Me.Left -= 25
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        LblTimer.Text = PrivateField
    End Sub
End Class
